package io.renren.modules.api.service;

import io.renren.modules.psorder.entity.PsOrderEntity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 *
 * Created by WDJ on 2017/12/15.
 */
public interface IPayService {

    /**
     * 手机支付宝支付配送订单 新版
     * @param orderNum 配送订单号
     * @param couponid 优惠券id(如果有就传)
     * @return
     */
    String appAliPayPsOrder(String orderNum,Long couponid);

    /**
     * 手机支付宝支付配送订单 旧版
     * @param orderNum 配送订单号
     * @param couponid 优惠券id(如果有就传)
     * @return
     */
    String appAliPayPsOrderOld(String orderNum,Long couponid);

    /**
     * 支付宝异步通知 新版本
     * @param response 响应对象
     * @param request 请求对象
     * @throws Exception
     */
    void aliPayPsOrderNotify(HttpServletResponse response, HttpServletRequest request) throws Exception;

    /**
     *  支付宝异步通知 老版本
     * @param response 响应对象
     * @param request 请求对象
     * @throws Exception
     */
    void aliPayPsOrderNotifyOld(HttpServletResponse response, HttpServletRequest request) throws Exception;

    /**
     * 手机微信支付配送订单
     * @param orderNum 配送订单号
     * @return
     */
    Map<String, Object> appWxPayPsOrder(String orderNum, HttpServletRequest request,
                                        HttpServletResponse response);


    Map<String, Object> appWxPayPsOrderOld(String orderNum,Long couponid,HttpServletRequest request,
                                                  HttpServletResponse response) throws Exception;

    void wxPayPsOrderNotify(HttpServletResponse response, HttpServletRequest request) throws Exception;

    void wxPayPsOrderNotifyOld(HttpServletResponse response, HttpServletRequest request) throws Exception;

    void updateOrAddDriverStatistics(PsOrderEntity psOrder, String payType);

}
